using System.Collections.Generic;
using System.Linq;
using System.Windows;
using GraphMyCode.Client.AssemblyService;
using GraphMyCode.Client.Utils;

namespace GraphMyCode.Client.ViewModels
{
	public class LegendViewModel : ViewModelBase
	{
		public LegendViewModel(LegendDto dto)
		{
			Items = new List<NodeViewModel>(
				dto.Items.Select(
					i => new NodeViewModel(-1, new Point(0, 0), dto.ItemSize, ColorConverter.FromString(i.Color), i.Shape, i.Text,
					                       string.Empty)));
		}

		public IEnumerable<NodeViewModel> Items { get; private set; }
	}
}